package com.my.chapter3;

public class practice5AND6 {
    public static void main(String[] args) {
        //practice5
        Dog d1=new Dog();
        d1.name="spot";
        d1.says="Ruff!";
        Dog d2=new Dog();
        d2.name="scruffy";
        d2.says="Wurf!";
        d1.show();
        d2.show();

        //practice6
        Dog d3=new Dog();
        d3=d1;
        System.out.println(d1==d3);
        System.out.println(d1.equals(d3));
    }
}

class Dog{
    String name;
    String says;
    public void show(){
        System.out.println("名字："+name+"；叫声："+says);
    }
}
